#ifndef MAILLOGINWIDGET_H
#define MAILLOGINWIDGET_H

#include <QWidget>
#include <QGridLayout>
#include <QLineEdit>
#include <QPushButton>
#include <QLabel>

class MailLoginWidget : public QWidget
{
    Q_OBJECT
public:
    explicit MailLoginWidget(QWidget *parent = nullptr);

    void setIsLogin(bool isLogin)
    {
        _isLoginMode = isLogin;
        if (_isLoginMode)
        {
            this->setWindowTitle("登录");
            _titleLabel->setText("登录");
            _submitBtn->setText("登录");
            _usernameModBtn->setText("用户名登录");
            _switchModBtn->setText("注册");
        }
        else
        {
            this->setWindowTitle("注册");
            _titleLabel->setText("注册");
            _submitBtn->setText("注册");
            _usernameModBtn->setText("用户名注册");
            _switchModBtn->setText("登录");
        }
    }
private:
    QGridLayout *_layout;
    QLabel *_titleLabel;
    QLineEdit *_mailNumberEdit;
    QLineEdit *_verifyCodeEdit;
    QPushButton *_verifyCodeBtn;
    QPushButton *_submitBtn;
    QPushButton *_usernameModBtn;
    QPushButton *_switchModBtn;

    bool _isLoginMode;

signals:
};

#endif // MAILLOGINWIDGET_H
